#pragma once

#include <QObject>
#include <QHostAddress>
#include <memory>
#include "GamePacket.h"
#include "UniversalProtocol.h"
#include "ProtocolAdapters.h"

// 网络工作线程类
class NetworkWorker : public QObject 
{
    Q_OBJECT
    
public:
    explicit NetworkWorker(QObject* parent = nullptr);
    ~NetworkWorker() override;

public slots:
    void processPacket(const QByteArray& data, const QHostAddress& sender, quint16 port);

signals:
    void packetProcessed(std::shared_ptr<GamePacket> packet, const QHostAddress& sender, quint16 port);
    void universalMessageProcessed(std::shared_ptr<UniversalProtocol::UniversalMessage> message, const QHostAddress& sender, quint16 port);
}; 